#include "testApp.h"
#include "stdio.h"

//--------------------------------------------------------------
void testApp::setup(){

//function that creates an ammount of entities
    world.createThings(5);

//the look of your entities
    img.loadImage("images/Ball.png");

//most round objects must include alpha
    ofEnableAlphaBlending();
}

//--------------------------------------------------------------
void testApp::update(){
//adding the calculations
    world.update();

}


//--------------------------------------------------------------
void testApp::draw(){
//this following script is used to rotate/place each entity
//world.draw(); use this script for simple circles
    for(int i=0;i<world.things.size();i++) {
        ofPushMatrix();
            ofTranslate(world.things[i].y, world.things[i].x);
            img.setAnchorPercent(.5,.5);
            ofRotate(world.things[i].degrees);
            img.draw(0,0,world.things[i].weight,world.things[i].weight);
        ofPopMatrix();
    }
}
